<template>
  <!--
        作者：1550495493@qq.com
        时间：2019-08-17
        描述：工作日志
    -->
  <div class="Announcements">
    <div class="Website-visits">
      <div class="location">
        <div class="location-text fl">
          <img class="location-img fl" src="../../images/BaseManager/workLog.png" />
          <p class="fr">工作日志</p>
        </div>
        <img class="biaotibg fl" src="../../images/home/biaotibg.png" />
      </div>
      <div class="search-box">
        <div class="fl">
          <label>项目名称：</label>
          <input type="text" id="search" class="search" v-model="search"/>
          <input class="btn" @click="getData" type="button" value="搜索" />
        </div>
      </div>
      <div class="PressRelease-list">
        <table>
          <thead>
          <tr>
            <th class="w200">基地名称</th>
            <th class="w200">项目名称</th>
            <th>需指导次数</th>
            <th>已指导次数</th>
            <!--<th>剩余次数</th>-->
            <th>工作记录</th>
            <th>项目状态</th>
            <!--<th>打卡记录</th>-->
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          <tr v-if="cooperativeProjectList.length == 0">
            <td colspan="7" class="center">暂无数据！</td>
          </tr>
          <tr v-for="cooperativeProject in cooperativeProjectList">
            <td :title="cooperativeProject.areasName"><span class="show-twoline">{{cooperativeProject.areasName}}</span></td>
            <td :title="cooperativeProject.projectName"><span class="show-twoline">{{cooperativeProject.projectName}}</span></td>
            <td>{{cooperativeProject.projectGuide}}</td>
            <td>{{cooperativeProject.projectAlready}}</td>
           <!-- <td>{{expertWorkLog.projectAlready - expertWorkLog.projectGuide > 0 ? expertWorkLog.projectAlready - expertWorkLog.projectGuide : 0}}</td>-->
            <!--<td><input @click="rorkRecord(cooperativeProject.projectId,cooperativeProject.expertId)" type="button" value="查看" class="delete write" /></td>-->
            <td><input @click="demand(cooperativeProject.projectId,cooperativeProject.expertId)" type="button" value="查看" class="delete write" /></td>
            <td>
              <template v-if="cooperativeProject.areasStatus == 6 || cooperativeProject.areasStatus == 3 ">
                无效
              </template>
              <template v-else>
                <template v-if="cooperativeProject.projectClosureAuditStatus == 2 || cooperativeProject.projectClosureAuditStatus == 3">
                  已结题
                </template>
                <template v-else>
                  有效
                </template>
              </template>
            </td>
            <td><input @click="projectDetails(cooperativeProject.projectId,cooperativeProject.expertId)" type="button" value="编写" class="delete write" v-if="cooperativeProject.projectClosureAuditStatus == 2 || cooperativeProject.projectClosureAuditStatus == 3 || cooperativeProject.areasStatus == 6 || cooperativeProject.areasStatus == 3 ? false : true"/></td>
          </tr>
          </tbody>
        </table>
        <!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
        <pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
      </div>
    </div>

    <!-- 编写-模态框-->
    <div v-show="ProjectModelShow" class="tenant-model">
      <div class="tenant-model-content demandModel to-write">
        <header class="tenant-model-header">
          <h3>编写工作记录</h3>
          <span @click="closeModel" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--模态框内容板块-->
            <form class="form-box" id="logForm">
              <input type="hidden" name="projectId" :value="expertProjectWorkLog.projectId" />
              <input type="hidden" name="expertId" :value="expertProjectWorkLog.expertId" />
              <!--<div class="form-line input-required">
                <label>主题：</label>
                <div class="input-box">
                  <input type="text" name="theme">
                </div>
              </div>-->
              <div class="form-line input-required">
                <label>时间：</label>
                <div class="input-box">
                  <!--<input type="text" name="beginTime" id="beginTime">-->
                  <el-date-picker
                    name="beginTime"
                    format="yyyy-MM-dd"
                    v-model="expertProjectWorkLog.beginTime"
                    type="date"
                    @change="timeChange($event)"
                    placeholder="选择日期">
                  </el-date-picker>
                </div>
              </div>
              <!--<div class="form-line input-required">
                <label>结束时间：</label>
                <div class="input-box">
                  &lt;!&ndash;<input type="text" name="beginTime" id="beginTime">&ndash;&gt;
                  <el-date-picker
                    name="endTime"
                    v-model="expertProjectWorkLog.endTime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                </div>
              </div>-->
              <div class="form-line input-required">
                <label>地点：</label>
                <div class="input-box address">
                  <input type="text" name="position">
                </div>
              </div>
              <div class="form-line input-required">
                <label class="textarea-label">事由：</label>
                <div class="input-box">
                  <textarea name="content"></textarea>
                </div>
              </div>
              <div class="form-line">
                <label>图片：</label>
                <div class="imgbtn">
                  <input name="picture" type="hidden"/>
                  <input type="file" id="handIdFront" accept="image/*" @change="idFrontImg($event)" style="display: none;" />
                  <img id="showHandIdFront" class="showHandIdFront"/>
                  <a class="Public-btn1 uploadbtn again-upload " @click="touchOffIdInput(1)">重新上传</a>
                  <a class="Public-btn1 uploadbtn handIdFrontA " @click="touchOffIdInput(1)">上传</a>
                </div>
              </div>
              <input type="reset" style="display: none"/>
            </form>
          </div>
        </div>
        <footer class="tenant-model-footer">
          <button class="determine" @click="subLog">确定</button>
        </footer>
      </div>
    </div>
    <!-- 打卡记录-模态框-->
    <div v-if="demandModelShow" class="tenant-model">
      <div class="tenant-model-content demandModel to-write">
        <header class="tenant-model-header">
          <h3>查看工作记录</h3>
          <span @click="closeModel" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body secondLevelPageination">
          <div class="search-contain">
            <!--模态框内容板块-->
            <!--<table>
              <tr>
                <th>序号</th>
                <th>打卡时间</th>
                <th>打卡地点</th>
                <th>打卡事由</th>
              </tr>
              <tr v-for="(expertWorkLog,index) in expertWorkLogList">
                <td>{{index + 1}}</td>
                <td>{{formatData(expertWorkLog.createAt)}}</td>
                <td>{{expertWorkLog.position}}</td>
                <td>{{expertWorkLog.content}}</td>
              </tr>
            </table>-->
            <table>
              <tr>
                <th class="w120">时间</th>
                <th class="w250">事由</th>
                <th class="w250">地点</th>
                <th class="w80">附件</th>
              </tr>
              <tr v-if="expertWorkLogList.length == 0">
                <td colspan="4" class="center">暂无数据！</td>
              </tr>
              <tr v-for="expertWorkLog in expertWorkLogList">
                <td>{{formatData(expertWorkLog.beginTime)}}</td>
                <td :title="expertWorkLog.content"><span class="show-oneline-table">{{expertWorkLog.content}}</span></td>
                <td :title="expertWorkLog.position"><span class="show-oneline-table">{{expertWorkLog.position}}</span></td>
                <td><input type=" button" @click="preview2(expertWorkLog.picture)" class="delete write" value="预览" /></td>
              </tr>
            </table>
            <!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
            <pageination :total="baseTotal" :size="baseSize" :page="basePage" :changge="basePageFn" @child="obtainChild"></pageination>
          </div>
        </div>
      </div>
    </div>
    <!-- 履行日志记录-模态框-->
    <div v-if="WorkModelShow" class="tenant-model">
      <div class="tenant-model-content">
        <header class="tenant-model-header">
          <h3>履行日志记录</h3>
          <span @click="closeModels" id="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--模态框内容板块-->
            <div class="rork-ecord" v-for="expertWorkLog in expertWorkLogList">
              <p>时间：{{formatData(expertWorkLog.beginTime, "yyyy-MM-dd hh:mm:ss")}}</p>
              <p>事由：{{expertWorkLog.content}} </p>
              <p  v-if="expertWorkLog.picture != null && expertWorkLog.picture != ''">图片：<img :src="expertWorkLog.picture"/></p><br />
              <!--<div class="situation-two">2.现场实际考察</div>-->
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

</template>
<script src="./JobLog.js"></script>

<style scoped>
  @import "JobLog.css";
</style>
